﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
	mc:Ignorable="d"
	x:Class="MVVM_CAD.ToolsMenu"
	x:Name="UserControl"
	d:DesignWidth="71.356" Width="85" Height="601"
	DataContext="{Binding Tools, Source={StaticResource Locator}}">
	<UserControl.Resources>
		<Style x:Key="ToolButton" TargetType="{x:Type Button}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<i:Interaction.Triggers>
								<i:EventTrigger EventName="MouseLeave">
									<ei:GoToStateAction x:Name="OnMouseLeaveForButton" StateName="OnMouseLeave"/>
								</i:EventTrigger>
								<i:EventTrigger EventName="MouseEnter">
									<ei:GoToStateAction x:Name="OnMouseEnterForButton" StateName="OnMouseOver"/>
								</i:EventTrigger>
							</i:Interaction.Triggers>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="ButtonMouseOver">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.2"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="OnMouseLeave">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
											</ObjectAnimationUsingKeyFrames>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle">
												<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
											</DoubleAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="OnMouseOver">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
											</ObjectAnimationUsingKeyFrames>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle">
												<EasingDoubleKeyFrame KeyTime="0" Value="0.275"/>
											</DoubleAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Rectangle Fill="#FF838383" RadiusY="5" RadiusX="5" Stroke="#FF6C6C6C"/>
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
							<Rectangle x:Name="rectangle" RadiusY="5" RadiusX="5" Stroke="#FF6C6C6C" Opacity="0" Visibility="Visible">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="Black" Offset="0.151"/>
										<GradientStop Color="White" Offset="1"/>
										<GradientStop Color="White" Offset="1"/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsFocused" Value="True"/>
							<Trigger Property="IsDefaulted" Value="True"/>
							<Trigger Property="IsMouseOver" Value="True"/>
							<Trigger Property="IsPressed" Value="True"/>
							<Trigger Property="IsEnabled" Value="False"/>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" Width="72" Margin="6.5,15,6.5,27">
		<VisualStateManager.VisualStateGroups>
			<VisualStateGroup x:Name="ToolMenuState">
				<VisualStateGroup.Transitions>
					<VisualTransition GeneratedDuration="0:0:0.5">
						<VisualTransition.GeneratedEasingFunction>
							<PowerEase EasingMode="EaseInOut"/>
						</VisualTransition.GeneratedEasingFunction>
					</VisualTransition>
				</VisualStateGroup.Transitions>
				<VisualState x:Name="MouseOut">
					<Storyboard>
						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="grid">
							<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
						</DoubleAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
				<VisualState x:Name="MouseEnter">
					<Storyboard>
						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="grid">
							<EasingDoubleKeyFrame KeyTime="0" Value="72"/>
						</DoubleAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>
		<VisualStateManager.CustomVisualStateManager>
			<ei:ExtendedVisualStateManager/>
		</VisualStateManager.CustomVisualStateManager>
		<Grid x:Name="grid" RenderTransformOrigin="0.5,0.5" Margin="0,0,0,-12">
			<Grid.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Grid.RenderTransform>
			<i:Interaction.Triggers>
				<i:EventTrigger EventName="MouseLeave">
					<ei:GoToStateAction x:Name="OnMouseOut" StateName="MouseOut"/>
				</i:EventTrigger>
				<i:EventTrigger EventName="MouseEnter">
					<ei:GoToStateAction x:Name="OnMouseOver" StateName="MouseEnter"/>
				</i:EventTrigger>
			</i:Interaction.Triggers>
			<Rectangle x:Name="DragMenu" HorizontalAlignment="Right" Margin="0,181,-15.644,185.184" Width="23" RadiusX="5" RadiusY="5" Height="90">
				<Rectangle.Fill>
					<LinearGradientBrush EndPoint="0.852,0.524" StartPoint="0.074,0.525">
						<GradientStop Color="Black" Offset="0"/>
						<GradientStop Color="#FF626262" Offset="0.935"/>
					</LinearGradientBrush>
				</Rectangle.Fill>
			</Rectangle>
			<Rectangle x:Name="ToolContainer" Fill="#FF3D3D3D" Stroke="#FF959595" RadiusY="5" RadiusX="5" StrokeThickness="5" Width="72" Margin="0,4,0,13"/>
			<Button Content="Point" Height="54" Margin="8,12,8,0" Style="{DynamicResource ToolButton}" VerticalAlignment="Top" Command="{Binding PointToolCommand}"/>
            <Button Content="Line" Height="54" Margin="8,70,8,0" Style="{DynamicResource ToolButton}" VerticalAlignment="Top" Command="{Binding LineToolCommand}"/>
            <Button Content="Polyline" Height="54" Margin="8,128,8,0" Style="{DynamicResource ToolButton}" VerticalAlignment="Top" Command="{Binding PolyLineToolCommand}"/>
            <Button Content="Selection" Margin="8,0,8,79" Style="{DynamicResource ToolButton}" Command="{Binding SelectionToolCommand}" Height="54" VerticalAlignment="Bottom"/>
            <Button Content="Circle" Height="54" Margin="8,186,8,0" Style="{DynamicResource ToolButton}" VerticalAlignment="Top" Command="{Binding CircleToolCommand}"/>
            <Button Content="Arc" Margin="8,244,8,273" Style="{DynamicResource ToolButton}" Command="{Binding ArcToolCommand}" Height="54"/>
            <Button Content="Polygon" Margin="8,0,8,215" Style="{DynamicResource ToolButton}" Command="{Binding PolygonToolCommand}" Height="54" VerticalAlignment="Bottom"/>
            <Button Content="Spline" Margin="8,0,8,157" Style="{DynamicResource ToolButton}" Command="{Binding SplineToolCommand}" Height="54" VerticalAlignment="Bottom"/>
            <Button Content="Delete" Margin="8,0,8,21" Style="{DynamicResource ToolButton}" Command="{Binding DeleteToolCommand}" Height="54" VerticalAlignment="Bottom"/>
            <Path Data="M13.5,425 L59.5,425" Fill="#89808080" Height="2" Margin="10.5,0,10.5,143" Stretch="Fill" Stroke="#69959595" StrokeThickness="5" VerticalAlignment="Bottom"/>
        </Grid>
	</Grid>
</UserControl>